MeshToLevelSet Rendering Fixes #5923
Merged
+8
−21
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Artists at ImageEngine were confused why they couldn't render the output from MeshToLevelSet in Arnold.
I started by not discarding the exception message when it fails to render, which revealed the exception: "LookupError: Cannot find metadata file_mem_bytes".
I think we can reasonably assume that any vdb loaded from disk should have this stats information, so there are two reasonable solutions: either make sure every volume produced in Gaffer has these stats computed, or make sure rendering falls back to using the
memUsage()
call that computes it if the metadata isn't found. I've currently gone with the first one, since there might be more of a possible performance hazard with the second ( there might be some sort of instancing setup where you could end up callingmemUsage()
many times? ), but I haven't thought too hard about it, and there might be an argument for the second approach.The obvious next step is that if people actually want to render the result of these operations as volumes, then they need a way to convert them to fog volumes rather than level sets. We should probably have a LevelSetToVolume node - but it would be pretty wasteful to cache both versions, so there probably ought to be a MeshToVolume node as well ( which does what the current MeshToLevelSet does, and then calls openvdb::LevelSetUtil::sdfToFogVolume in place on it ).